<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script>
	function getOddItem(arr){
		let itemMap = new Map()
		arr.forEach(item => {
			itemMap.set(item,(itemMap.get(item) || 0) + 1)
		})
		let result = []
		for(const [ele,value] of itemMap){
			if (value % 2 !== 0){
				result.push(ele)
			}
		}
		return result
	}
	// 基础用例
	console.log(getOddItem([1,1,2,2,3]));     // [3]
	console.log(getOddItem([4,4,4]));         // [4]
	console.log(getOddItem([2,2,3,3,3]));     // [3]
	
	// 多个奇数情况
	console.log(getOddItem([1,1,2,3,]));     // [2,3]
	console.log(getOddItem([5,5,5,5,5]));     // [5]（五次也是奇数次）
	
	// 边界情况
	console.log(getOddItem([]));              // []
	console.log(getOddItem([9]));             // [9]
	
	// 混合类型
	console.log(getOddItem(["a", "a", 7]));   // [7]

</script>
</html>